<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml">

<head>
    <meta content="text/html;charset = utf-8" http-equiv="content-type">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=0">
    <link href="../lib/AmazeUI-2.4.2/assets/css/amazeui.css" rel="stylesheet" type="text/css"/>
    <link href="../lib/AmazeUI-2.4.2/assets/css/admin.css" rel="stylesheet" type="text/css"/>

    <link href="../home/css/personal.css" rel="stylesheet" type="text/css">
    <link href="../home/css/infstyle.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../lib/jquery/jquery.min.js"></script>
    <script src="../lib/AmazeUI-2.4.2/assets/js/amazeui.js" type="text/javascript"></script>
    <script src="../lib/vue/2.4.2/vue.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../lib/elementui/1.4.3/theme-default/index.css">
    <script src="../home/js/vue.min.js"></script>
    <script src="../lib/elementui/1.4.3/index.js"></script>

</head>

<body>
<div id="PurchaseAndOrdesdetail">
    <!--标题 -->
    <div align="left"><span style="font-size: 18px;color: #409EFF">采购单项目主单详情</span></div>
    </br></br>
    <el-form ref="form" :model="urchaseAndOrdersdetail" label-width="80px" size="mini">

        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="采购单位名称">
                    <el-input :disabled="true" v-model="urchaseAndOrdersdetail.company_name"
                    ></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="联系人">
                    <el-input v-model="urchaseAndOrdersdetail.lxr"
                              :disabled="true"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="联系电话">
                    <el-input v-model="urchaseAndOrdersdetail.phone" :disabled="true"
                              @change="checkRole(urchaseAndOrdersdetail.phone)"></el-input>
                </el-form-item>
            </el-col>
        </el-row>


        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="项目名称">
                    <el-input v-model="urchaseAndOrdersdetail.entry_name"
                              :disabled="urchaseAndOrdersdetail.ifInput"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="采购预算">
                    <el-input v-model="urchaseAndOrdersdetail.bhdget_amount" :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.bhdget_amount)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="采购类别">
                    <el-select v-model="urchaseAndOrdersdetail.category" placeholder="请选择采购类别"
                               :disabled="urchaseAndOrdersdetail.ifInput">
                        <el-option label="货物" value="货物"></el-option>
                        <el-option label="工程" value="工程"></el-option>
                        <el-option label="服务" value="服务"></el-option>
                    </el-select>
                </el-form-item>
            </el-col>
        </el-row>

        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="财政拨款（补助）收入">
                    <el-input v-model="urchaseAndOrdersdetail.czbksr" @blur="onChanges"
                              :disabled="true"
                              @change="checkRole(urchaseAndOrdersdetail.czbksr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="纳入预算管理的行政事业性收费">
                    <el-input v-model="urchaseAndOrdersdetail.ysxzsysf" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.ysxzsysf)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="纳入预算管理的政府性基金">
                    <el-input v-model="urchaseAndOrdersdetail.yszfxjj" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.yszfxjj)"></el-input>
                </el-form-item>
            </el-col>
        </el-row>


        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="纳入预算管理的其他政府非税收入">
                    <el-input v-model="urchaseAndOrdersdetail.ysqtzffssr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.ysqtzffssr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="纳入财政专户管理的政府非税收入">
                    <el-input v-model="urchaseAndOrdersdetail.czzhggfsssr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.czzhggfsssr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="上级财政转移支付">
                    <el-input v-model="urchaseAndOrdersdetail.sjczzyzf" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.sjczzyzf)"></el-input>
                </el-form-item>
            </el-col>
        </el-row>


        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="事业收入">
                    <el-input v-model="urchaseAndOrdersdetail.sysr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.sysr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="经营收入">
                    <el-input v-model="urchaseAndOrdersdetail.yysr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.yysr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="上级补助收入">
                    <el-input v-model="urchaseAndOrdersdetail.sjbzsr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.sjbzsr)"></el-input>
                </el-form-item>
            </el-col>
        </el-row>

        <el-row :gutter="20">
            <el-col :span="8">
                <el-form-item label="附属单位上缴收入">
                    <el-input v-model="urchaseAndOrdersdetail.fsdwsjsr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.fsdwsjsr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="其他收入">
                    <el-input v-model="urchaseAndOrdersdetail.qtsr" @blur="onChanges"
                              :disabled="urchaseAndOrdersdetail.ifInput"
                              @change="checkRole(urchaseAndOrdersdetail.qtsr)"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="8">
                <el-form-item label="年初预算合计">
                    <el-input v-model="urchaseAndOrdersdetail.total" :disabled="true" @focus="onChanges"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row :gutter="20">
            <el-col :span="24">
                <el-form-item label="采购单位意见">
                    <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 8}" placeholder="请输入内容"
                              v-model="urchaseAndOrdersdetail.cgdwyj"
                              :disabled="urchaseAndOrdersdetail.ifInput"></el-input>
                </el-form-item>
            </el-col>
        </el-row>

        <div align="left" style="width:90%"
             v-if="urchaseAndOrdersdetail.type == '待审核'||(urchaseAndOrdersdetail.ifQuery !=null && urchaseAndOrdersdetail.ifQuery==true)">
            <el-row :gutter="20">
                <el-col :span="8">
                    <el-form-item label="采购组织形式">
                        <el-select v-model="urchaseAndOrdersdetail.cgxs" placeholder="请选择采购组织形式"
                                   :disabled="urchaseAndOrdersdetail.ifQuery">
                            <el-option label="政府集中采购" value="政府集中采购"></el-option>
                            <el-option label="部门集中采购" value="部门集中采购"></el-option>
                            <el-option label="分散采购" value="分散采购"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="委托代理机构">
                        <el-select v-model="urchaseAndOrdersdetail.wtdljg" placeholder="请选择委托代理机构"
                                   :disabled="urchaseAndOrdersdetail.ifQuery">
                            <el-option label="政府集中采购机构" value="政府集中采购机构"></el-option>
                            <el-option label="社会代理机构" value="社会代理机构"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="政府采购方式">
                        <el-select v-model="urchaseAndOrdersdetail.zfcgfs" placeholder="请选择委托代理机构"
                                   :disabled="urchaseAndOrdersdetail.ifQuery">
                            <el-option label="公开招标" value="公开招标"></el-option>
                            <el-option label="邀请招标" value="邀请招标"></el-option>
                            <el-option label="竞争性谈判" value="竞争性谈判"></el-option>
                            <el-option label="询价" value="询价"></el-option>
                            <el-option label="单一来源" value="单一来源"></el-option>
                            <el-option label="竞争性磋商" value="竞争性磋商"></el-option>
                            <el-option label="协议供货" value="协议供货"></el-option>
                            <el-option label="定点采购" value="定点采购"></el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>

        </div>
        <div align="left" style="width:90%"
             v-if="urchaseAndOrdersdetail.type === '待审核'||urchaseAndOrdersdetail.ifClose==true">
            <el-row :gutter="20">
                <el-col :span="24">
                    <el-form-item label="市政府采购办公室意见" :disabled="urchaseAndOrdersdetail.ifQuery">
                        <el-input type="textarea" :autosize="{ minRows: 3, maxRows: 8}" placeholder="请输入内容"
                                  v-model="urchaseAndOrdersdetail.szfcgbgsyj"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </div>
        <div class="am-g" align="left" style="width:90%"
             v-if="urchaseAndOrdersdetail.szfcgbgsyj !=null &&  urchaseAndOrdersdetail.type != '待审核'&& urchaseAndOrdersdetail.ifClose==false">
            <el-row :gutter="20">
                <el-col :span="24">
                    <el-form-item label="市政府采购办公室意见">
                        <el-input :disabled="true" type="textarea" :autosize="{ minRows: 3, maxRows: 8}"
                                  placeholder="请输入内容" v-model="urchaseAndOrdersdetail.szfcgbgsyj"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
        </div>
    </el-form>
    <p align="left" style="color: #2fa0ec; font-size: 14px">采购清单</p>
    <table class="am-table am-table-bordered am-table-radius am-table-striped am-table-striped am-table-hover">
        <thead>
        <tr>
            <th style="text-align:center;">商品名称</th>
            <th style="text-align:center;">品目名称</th>
            <th style="text-align:center;">品目编码</th>
            <th style="text-align:center;">规格型号</th>
            <th style="text-align:center;">主要配置及技术参数</th>
            <th style="text-align:center;">单位</th>
            <th style="text-align:center;">数量</th>
            <th style="text-align:center;">单价</th>
            <th style="text-align:center;">总价</th>
            <th style="text-align:center;">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr v-for="shopData in ordersDetails">
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.goodsName}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.pmmc}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.pmbm}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.ggxh}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.jscs}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.dw}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.sl}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.dj}}</td>
            <td v-on:click="openAddPurchaseDetils(shopData,urchaseAndOrdersdetail.type)">{{shopData.zj}}</td>
            <td v-if="(urchaseAndOrdersdetail.type === '审核通过'&& urchaseAndOrdersdetail.purchaseClose==false)||(urchaseAndOrdersdetail.type === '待审核'&&urchaseAndOrdersdetail.queryFlag==false)">
                        <span v-if="shopData.type === '审核通过'">
                        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                                v-on:click="toBinbind(shopData,true)">询价
                        </button>
                            <SPAN v-if="shopData.orderCarGlgx !=null">
                        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                                v-on:click=" toShoping(shopData,true)">购买
                        </button></SPAN>
                            <SPAN v-if="shopData.orderCarGlgx !=null">
                        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                                v-on:click="toBinbind(shopData,false)">关闭历史询价
                        </button></SPAN>
                        </span>
                <SPAN v-if="(urchaseAndOrdersdetail.type === '待审核'&&urchaseAndOrdersdetail.queryFlag==false)">
                        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                                v-on:click="queryContrastDetail(shopData)">商品对比详情
                        </button></SPAN>
            </td>
            <td v-if="(urchaseAndOrdersdetail.type === '申请')">
                <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                        v-on:click="deleteContrastDetail(shopData)">删除
                </button>
            </td>
        </tr>
        </tbody>
    </table>
    <br>
    <div align="center" v-if="urchaseAndOrdersdetail.type === '申请'">
        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                v-on:click="toSave(urchaseAndOrdersdetail,urchaseAndOrdersdetail.id)">保&nbsp;&nbsp;&nbsp;&nbsp;存
        </button>
        &nbsp;&nbsp;&nbsp;&nbsp;

        <button v-if="addYourselfSwitch" type="button" class="am-btn am-btn-default am-round am-btn-success"
                v-on:click="toAdd(urchaseAndOrdersdetail,urchaseAndOrdersdetail.id)">增加清单
        </button>

        &nbsp;&nbsp;&nbsp;&nbsp;

        <button type="button" class="am-btn am-btn-default am-round am-btn-success" v-on:click="toPass('提交审核')">提交审核
        </button>
    </div>

    <div align="center" v-if="(urchaseAndOrdersdetail.type === '待审核'&&urchaseAndOrdersdetail.queryFlag==false)">
        <button type="button" class="am-btn am-btn-default am-round am-btn-success"
                v-on:click="toSave(urchaseAndOrdersdetail,urchaseAndOrdersdetail.id)">保&nbsp;&nbsp;&nbsp;&nbsp;存
        </button>
        &nbsp;&nbsp;&nbsp;&nbsp;

        <button type="button" class="am-btn am-btn-default am-round am-btn-success" v-on:click="toPass('审核通过')">审核通过
        </button>
        &nbsp;&nbsp;&nbsp;&nbsp;

        <button type="button" class="am-btn am-btn-default am-round am-btn-danger" v-on:click="toPass('审核不通过')">审核不通过
        </button>
    </div>
    <div class="am-g" align="center" style="width:90%" v-if="urchaseAndOrdersdetail.ifClose==true">
        <button type="button" class="am-btn am-btn-default am-round am-btn-danger" v-on:click="toPass('作废')">&nbsp;&nbsp;作&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;废&nbsp;&nbsp;
        </button>
    </div>
    <div class="am-g" align="center" style="width:90%" v-if="urchaseAndOrdersdetail.purchaseClose==true">
        <button type="button" class="am-btn am-btn-default am-round am-btn-danger" v-on:click="toPass('申请作废')">申请作废
        </button>
    </div>
    <!-- Form -->
    <el-dialog title="增加采购清单" :visible.sync="dialogFormVisible">
        <el-form :model="form">
            <el-row :gutter="20">
                <el-col :span="16">
                    <el-form-item label="品目名称" :label-width="formLabelWidth">
                        <el-cascader :options="form.category" v-model="form.selectedOptions"
                                     placeholder="品目名称"></el-cascader>
                        <span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{form.purchaseOrderDetail.pmmc}}</span>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="商品名称" :label-width="formLabelWidth">
                        <el-input v-model="form.purchaseOrderDetail.goodsName" auto-complete="off"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="20">
                <el-col :span="8">
                    <el-form-item label="规格型号" :label-width="formLabelWidth">
                        <el-input v-model="form.purchaseOrderDetail.ggxh" auto-complete="off"
                                  id="user-name3"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="单位" :label-width="formLabelWidth">
                        <el-input v-model="form.purchaseOrderDetail.dw" auto-complete="off" id="user-name4"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="数量" :label-width="formLabelWidth">
                        <el-input @blur="onChange" @change="checkRole(form.purchaseOrderDetail.sl)"
                                  v-model="form.purchaseOrderDetail.sl" auto-complete="off" id="user-name5"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="20">
                <el-col :span="8">
                    <el-form-item label="单价" :label-width="formLabelWidth">
                        <el-input @blur="onChange" v-model="form.purchaseOrderDetail.dj"
                                  @change="checkRole(form.purchaseOrderDetail.dj)" auto-complete="off"
                                  id="user-name6"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="总价" :label-width="formLabelWidth">
                        <el-input v-model="form.purchaseOrderDetail.zj" auto-complete="off" id="user-name7"
                                  :disabled="true"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <el-form-item label="品目编码" :label-width="formLabelWidth">
                        <el-input readonly="readonly" v-model="form.purchaseOrderDetail.pmbm" auto-complete="off"
                                  v-on:focus="onSelectMenu" type="text" id="user-name2"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row :gutter="20">
                <el-col :span="20">
                    <el-form-item label="技术参数" :label-width="formLabelWidth">
                        <textarea rows="4" cols="60" name="comment" resize="none"
                                  v-model="form.purchaseOrderDetail.jscs" id="user-name8"></textarea>
                    </el-form-item>
                </el-col>
            </el-row>


        </el-form>
        <div slot="footer" class="dialog-footer" align="center">
            <el-button @click="dialogFormVisible = false">取 消</el-button>
            <el-button type="primary" @click="addPurchaseDetail">确 定</el-button>
        </div>
    </el-dialog>
    <el-dialog title="商品对比采购详情" :visible.sync="dialogFormContrast">
        <div class="modal-body">
            <table class="table table-bordered" style="margin: auto">

                <thead style="align-content: center">
                <tr>
                    <td>货物名称</td>
                    <td>市场价格</td>
                    <td>入围价格</td>
                    <td>商品总销量</td>
                    <td>品牌信息</td>
                    <td>商品型号</td>
                    <td>供应商</td>
                    <td>生产厂商</td>
                </tr>
                <tr v-for="contrast in contrastInformation">
                    <td>{{contrast.commodityName}}</td>
                    <td>{{contrast.commodityMakPrc}}</td>
                    <td>{{contrast.commodityTrcPrc}}</td>
                    <td>{{contrast.salesGross}}</td>
                    <td>{{contrast.brand}}</td>
                    <td>{{contrast.model}}</td>
                    <td>{{contrast.businessesName}}</td>
                    <td>{{contrast.manufacturer}}</td>
                </tr>
                </tbody>
            </table>
        </div>
        <div slot="footer" class="dialog-footer" align="center">
            <el-button @click="dialogFormContrast = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormContrast = false">确 定</el-button>
        </div>
    </el-dialog>


</div>
<script src="../charge/PurchaseAndOrdersdetail.js"></script>
</body>


</html>

